<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>saiku多维分析</title>
</head>
<body>
	<script>
		$(function(){
			//关闭当前tab页面
			$("#navTabs > li[class='active']").find("button[class='close']").click();
			var args = '../saiku/index.html';
			var t1 ;
			groupSchemaConfig.hospCode=paramTabPage[tabId].hospCode ; 
			if(isEmpty(groupSchemaConfig.selectedGroupScheme) || isEmpty(groupSchemaConfig.hospCode)){
				//使用方法名字执行方法  
				t1 = setInterval(redirection,50);  
				switchDialog.show();
			} else {
				args = addUrlPara(groupSchemaConfig,args)
				open(args);
			}
			//定时器 异步运行  
			function redirection(){
				//console.log(groupSchemaConfig.selectedGroupScheme)
				if(!isEmpty(groupSchemaConfig.selectedGroupScheme) && !isEmpty(groupSchemaConfig.hospCode)){
					clearInterval(t1);//去掉定时器  
					args = addUrlPara(groupSchemaConfig,args)
					open(args);
				}
			}  
			
			//判断字符是否为空的方法
			function isEmpty(obj){
			    if(typeof obj == "undefined" || obj == null || obj == ""){
			        return true;
			    }else{
			        return false;
			    }
			}
		});
		
		// 向url添加参数
		function addUrlPara(param,currentUrl) {
			for(var key in param){
				if (/\?/g.test(currentUrl)) {
					if (/key=[-\w]{4,25}/g.test(currentUrl)) {  
					    currentUrl = currentUrl.replace(/key=[-\w]{4,25}/g, key + "=" + encodeURI(param[key]));  
					} else {
					    currentUrl += "&" + key + "=" + encodeURI(param[key]);  
					}  
				} else {  
				      currentUrl += "?" + key + "=" + encodeURI(param[key]);  
				} 
			}
			return currentUrl ;
		} 
		
	</script>
<!--  <a href="http://localhost:8080/" target="view_frame">多维分析</> -->
</body>
</html>